package com.example.demo.vo;

import java.math.BigDecimal;

/**
 * 购物车对象类
 */
public class CartItemVO {
    //商品id
    private Integer productId;
    //商品标题
    private String productTitle;
    //商品图片
    private String productImg;
    //购买数量
    private Integer byNum;
    //价格
    private Integer price;
    //总价
    private Integer totalPrice;

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public String getProductTitle() {
        return productTitle;
    }

    public void setProductTitle(String productTitle) {
        this.productTitle = productTitle;
    }

    public String getProductImg() {
        return productImg;
    }

    public void setProductImg(String productImg) {
        this.productImg = productImg;
    }

    public Integer getByNum() {
        return byNum;
    }

    public void setByNum(Integer byNum) {
        this.byNum = byNum;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public Integer getTotalPrice() {
        return totalPrice = this.price * this.byNum;
    }

    /**
     * 总价位购买数量乘与单价
     * @param totalPrice
     */
    public void setTotalPrice(Integer totalPrice) {
        this.totalPrice =  totalPrice;
    }
}
